home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / FNTPAK32.ZIP / PASCAL.EXE / FONT_PAK.PAS < prev    next >
Pascal/Delphi Source File  |  1995-08-16  |  7KB  |  207 lines

  1.  
  2. {========================================================== Font_Pak.Pas
  3.  
  4.     A Pascal unit declaring Font Pak procedures and functions.
  5.  
  6.     ALL procedures are FAR calls!  BE SURE to declare callable
  7.     OBJ fonts as FAR calls by using $F+.  See below for an example.
  8.  
  9.     Except in one case, pass ALL parameters by VALUE.
  10.  
  11.     The exception is rsButtonPressed.  Pass Row and Column
  12.     by reference (Var) so we can update them.
  13.  
  14.  
  15.  ========================================================== Font_Pak.Pas}
  16.  
  17. Unit Font_Pak;
  18.  
  19. {============================================================ Interface }
  20.  
  21. Interface
  22.  
  23. {============================================= LINK required OBJs fonts    }
  24.  
  25. {$Define FP_Shareware}                 { determines what's linked below    }
  26.                                    { Delete this in REGISTERED versions    }
  27.  
  28. {$IFDEF FP_Shareware}
  29.  
  30.   {$L fontpakP.OBJ}   { Shareware versions include 1 OBJ which contains ALL
  31.                        procedures (except LoadFontFile which is in ONDisk).
  32.                        BE SURE to link the "P" (Pascal) version!           }
  33. {$ELSE}
  34.  
  35.    {$L Video.OBJ}      { REGISTERED versions }
  36.    {$L Fonts.OBJ}
  37.    {$L GFX_Font.OBJ}
  38.    {$L Mouse_P.OBJ}
  39.    {$L LDCursor.OBJ}
  40.    {$L LdGFXcur.OBJ}
  41.    {$L LdSymbol.OBJ}
  42.  
  43. {$ENDIF}
  44.  
  45.  
  46. {=========================== Sample declarations for CALLable fonts        }
  47.  
  48. { Declare YOUR callable OBJ fonts here -- those you create with Font2Asm   }
  49. { Declaring them in the INTERFACE ensures Pascal will make FAR calls --    }
  50. { as is REQUIRED by all our ASM routines.                                  }
  51.  
  52.   (* {$F+}  procedure [fontname.ext] (Block: integer); {$F-}              *)
  53.  
  54.   (* ^^^^^ redundant here; but use {$F+} if you declare fonts in programs *)
  55.  
  56. {==================================== Video-related procedures -- Video.Obj}
  57.  
  58. procedure fpInitialize;      { required in shareware versions only }
  59.  
  60.  
  61. { determine type of monitor in use }
  62. function GetMonitor: integer;
  63.  
  64. { select brite backgrounds or blinking }
  65. procedure BrightBG (OnOff: integer);
  66.  
  67. { switch color palettes to achieve bright backgrounds, preserve blinking colors}
  68. procedure DefaultPalette (Which: integer);
  69.  
  70. {select dark blue background, preserve blinking -- a subset of DefaultPalette}
  71. procedure DarkBlue;
  72.  
  73. function  SetMaxLines(FontHeight: Integer): Integer;
  74. procedure WriteChar  (Row, Column, AsciiCode, Colr: Integer);
  75. procedure SetCursorPos(Row, Column : Integer);
  76.  
  77.  
  78. {========================= Text-mode Font-related procedures -- Fonts.Obj}
  79.  
  80. { select 1 or 2 blocks to turn on font(s) you loaded into these blocks }
  81. procedure rsWhichFonts  (LoIntensity, HiIntensity: integer);
  82.  
  83. { pre-load font blocks, or restore default font }
  84. procedure rsLoadDefault (WhichSize, Block: integer);
  85.  
  86. { called by ONDISK... routines, help load font from disk, or a transformed one }
  87.  
  88. procedure rsLoadFont (bufSegAddr:Pointer; Block, NumChars, FontHeight, FirstChar: integer);
  89.  
  90. { alternate declaration :::  segment & address passed as 2 integers }
  91. { procedure rsLoadFont (bufSeg, bufAddr, Block, NumChars, FontHeight, FirstChar: integer);}
  92.  
  93. {=========================================== Mouse-related procedures }
  94.  
  95. { initialze the mouse, see if there is one }
  96. function rsThereIsAMouse:integer;
  97.  
  98. { hide or display mouse cursor }
  99. procedure rsHidecursor;
  100. procedure rsShowcursor;
  101.  
  102. { rsButtonPressed returns which mouse button was pressed, and if so, where.
  103.  
  104.   - NOTE that Row and Column MUST be passed by reference so we can update them.
  105.  
  106.   - GFXorText:  Pass 0 to get text mode Row/Col,
  107.                 or  -1 to get graphics mode pixel coordinates
  108.  
  109.   - returns which button was pressed:  0 (none) 1 (left) 2(right)
  110.                                        3 (both) 4 (middle)
  111. }
  112. function rsButtonPressed (Var MouseRow, MouseCol:Integer; GFXorText: Integer):Integer;
  113.  
  114.  
  115. {=================================== TEXT-mode mouse shape procedures }
  116.  
  117. { To select the ASCII char to be used as mouse cursor shape. }
  118. { Also select the colors of mouse cursor.                    }
  119.  
  120. procedure rsSetTextCursor  (ForeGround, BackGround, AsciiChar:Integer);
  121. procedure rsSetTextCursorC (AsciiChar:Integer);
  122.  
  123. { To select a mouse cursor shape from our custom library of shapes: 8x16 or 8x8}
  124. procedure rsLoadMouseCursor (Block, WhichShape, ASCIICode:Integer);
  125. procedure rsLoadMouse8      (Block, WhichShape, ASCIICode:Integer);
  126.  
  127. { determine how many 16- and 8-point mouse shapes are in our libraries }
  128. function Num16Shapes: integer;
  129. function Num8Shapes:  integer;
  130.  
  131.  
  132. {=================================== GRAPHICS-mode mouse shape procedures }
  133.  
  134. { To select a GRAPHICS-MODE mouse cursor shape from a library of shapes. }
  135.  
  136. procedure rsLoadGFXCursor (WhichShape, HotSpotX, HotSpotY : Integer);
  137. function  NumGFXShapes : Integer;
  138.  
  139.  
  140. {====================================== TEXT-mode Symbol/Icon procedures }
  141.  
  142. { To select the 1- or 2-byte symbols or icons.  Also see     }
  143. { rsLoadMouseCursor which contains other 1-byte shapes which }
  144. { may be used as symbols/icons.                              }
  145.  
  146. procedure rsLoadSymbol (Block, WhichShape, ASCIICode:Integer);
  147. function  Num16Symbols : Integer;
  148. {============================== Graphics-mode Font-related procedures }
  149.  
  150. { in EGA/VGA graphics modes ONLY, select the 8-, 14- or 16-point font }
  151. { or restore the default font                                         }
  152.  
  153. procedure GFXFont08;
  154. procedure GFXFont14;
  155. procedure GFXFont16;
  156.  
  157.  
  158. {===================================================== Implementation }
  159. Implementation
  160.  
  161. { edit this to declare the callable OBJ fonts YOU create using Font2Asm }
  162.    {
  163.    procedure Hollow9;        external;
  164.    procedure Script1;        external;
  165.    procedure Frazzle;        external;
  166.    }
  167.  
  168. procedure fpInitialize;      external; { required in shareware versions only }
  169.  
  170. function  GetMonitor;        external;
  171. procedure BrightBG;          external;
  172. procedure DefaultPalette;    external;
  173. procedure DarkBlue;          external;
  174. function  SetMaxLines;       external;
  175. procedure WriteChar;         external;
  176. procedure SetCursorPos;      external;
  177.  
  178. procedure rsWhichFonts;      external;
  179. procedure rsLoadDefault;     external;
  180. procedure rsLoadFont;        external;
  181.  
  182. function  rsThereIsAMouse;   external;
  183. procedure rsHidecursor;      external;
  184. procedure rsShowcursor;      external;
  185. function  rsButtonPressed;   external;
  186. procedure rsSetTextCursor;   external;
  187. procedure rsSetTextCursorC;  external;
  188.  
  189. procedure rsLoadMouseCursor; external;
  190. procedure rsLoadMouse8;      external;
  191. function  Num16Shapes;       external;
  192. function  Num8Shapes;        external;
  193.  
  194. procedure GFXFont08;         external;
  195. procedure GFXFont14;         external;
  196. procedure GFXFont16;         external;
  197.  
  198. procedure rsLoadGFXCursor;   external;
  199. function  NumGFXShapes;      external;
  200.  
  201. procedure rsLoadSymbol;      external;
  202. function  Num16Symbols;      external;
  203.  
  204. End.
  205.  
  206.  
  207.